<template>
    <div class="mt-center">
        <!-- 轮播图 -->
        <mt-swipe :auto="4000">
            <mt-swipe-item v-for="(item,i) in imgList" :key="i">
                <a :href="item.url">
                    <img :src="item.img" alt="">
                </a>
            </mt-swipe-item>
        </mt-swipe>
        <!-- 菜单栏 -->
        <div class="mui-content">
            <ul class="mui-table-view mui-grid-view mui-grid-9">
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/news">
		                    <span class="mui-icon"></span>
		                    <div class="mui-media-body">新闻资讯</div></router-link></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/pictures">
		                    <span class="mui-icon"><span class="mui-badge">5</span></span>
		                    <div class="mui-media-body">图片分享</div></router-link></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/goods">
		                    <span class="mui-icon"></span>
		                    <div class="mui-media-body">商品购买</div></router-link></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/notes">
		                    <span class="mui-icon"></span>
		                    <div class="mui-media-body">留言反馈</div></router-link></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/vedio">
		                    <span class="mui-icon"></span>
		                    <div class="mui-media-body">视频专区</div></router-link></li>
		            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-4"><router-link to="/relation">
		                    <span class="mui-icon"></span>
		                    <div class="mui-media-body">联系我们</div></router-link></li>
		        </ul> 
		</div>
    </div>
</template>

<script>
export default {
  data() {
    return {
      imgList: null
    };
  },
  methods: {
    getData() {
      this.$http.get("http://vue.studyit.io/api/getlunbo").then(data => {
        // console.log(data.body.message);
        this.imgList = data.body.message;
      });
    }
  },
  created() {
    this.getData();
  },
  components: {}
};
</script>

<style lang="less" scoped>
.mt-center {
  width: 100%;
  height: 220px;
  .mint-swipe-items-wrap {
      width: 100%;
    > div {
      a {
        display: block;
        width: 100%;
        img {
          width: 100%;
        }
      }
    }
  }
  .mui-content {
    > .mui-table-view:first-child {
      margin-top: 0;
    }
    .mui-table-view-cell {
      .mui-icon {
        width: 50px;
        height: 50px;
        background-size: 100%;
      }
      &:nth-of-type(1) {
        .mui-icon {
          background-image: url("../assets/menu1.png");
        }
      }
      &:nth-of-type(2) {
        .mui-icon {
          background-image: url("../assets/menu2.png");
        }
      }
      &:nth-of-type(3) {
        .mui-icon {
          background-image: url("../assets/menu3.png");
        }
      }
      &:nth-of-type(4) {
        .mui-icon {
          background-image: url("../assets/menu4.png");
        }
      }
      &:nth-of-type(5) {
        .mui-icon {
          background-image: url("../assets/menu5.png");
        }
      }
      &:nth-of-type(6) {
        .mui-icon {
          background-image: url("../assets/menu6.png");
        }
      }
    }
  }
}
</style>